package com.zkingsoft.actions.customer;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zkingsoft.actions.common.BaseController;
import com.zkingsoft.anotations.SaveRequestToken;
import com.zkingsoft.model.ZdOrder;
import com.zkingsoft.plugin.pojo.PaginationVO;
import com.zkingsoft.plugin.util.WebUtil;
import com.zkingsoft.pojo.AjaxResult;
import com.zkingsoft.services.ZdOrderService;

/**
 * This field was generated by Zking.software.Codegen.
 * @date 2016-10-07 08:53
 */
@Controller
@RequestMapping(value = "customer/zdOrder")
public class CustomerZdOrderController extends BaseController{

	@Resource
	private ZdOrderService currentService;
	
	/**
	 * 列表显示
	 */
	@RequestMapping(value = "/findMyFy")
	public @ResponseBody AjaxResult findMyFy(ZdOrder zdOrder, PaginationVO pageVo) {
		zdOrder.setUserId(getMe().getId());
		return showList(currentService, zdOrder, pageVo);
	}
   	
	
   	/**
	 * 进入修改界面
	 */   
	@SaveRequestToken
   	@RequestMapping(value = "/editForm")
	public String editForm(Long id) {
		ZdOrder zdOrder;
		if (id != null) {
			zdOrder = currentService.findById(id);
			WebUtil.getRequest().setAttribute("obj", zdOrder);
		}
		return "admin/zdOrder-form";
	}
   	
   	
   	/**
	 * 删除
	 */  
 	@RequestMapping(value = "/del")
	public @ResponseBody AjaxResult del(String keys) {
		return remove(currentService, keys);
	}
  
}